/**
 * @file       IPEditField.h
 * @brief      TODO
 * @author     Huabo Zheng
 * @date       Jan 12, 2012
 * @Copyright  2012, www.netgear.com Inc. All rights reserved.
 */

#ifndef IPEDITFIELD_H_
#define IPEDITFIELD_H_

#include "EditField.h"

namespace NS_LCD_AFW
{

class CIPEditField: public NS_LCD_AFW::CEditField
{
public:
	CIPEditField();
protected:
	virtual ~CIPEditField();
public:

	int setIP(unsigned char filed1, unsigned char filed2, unsigned char filed3,
			unsigned char filed4);
	std::string getIP() const;
	int setIP(const std::string &ipAddr);
protected:
	virtual int setText(std::string text);
	virtual int onCreate();

public:
	static bool isValidIpAddress(const std::string & ipAddr);
	static std::string uChar2Str(unsigned char c);
	static std::string formatIpAddress(const std::string &ipAddr);

private:
	DISABLE_COPY_CONSTRUCTOR_AND_ASSIGN_REFERENCE(CIPEditField);

};

} /* namespace NS_LCD_AFW */
#endif /* IPEDITFIELD_H_ */
